This sample demonstrates the use of the Profile-Guided Optimization (PGO) feature of the Intel compilers. For details on the PGO feature, please refer to the compiler documentation.
Using PGO is a multistep process:
/Qprof-gen
(Windows*) or -prof-gen
(Linux*
and macOS*) specified. This creates an instrumented
executable.
.dyn
file with profile information.
/Qprof-use
(Windows) or -prof-use
(Linux*
and macOS*) specified. This will create an optimized
executable./Qopt-report:1
(Windows) or -qopt-report=1
which tells the
compiler to generate an optimization report with the lowest level of
detail.
/Qopt-report-phase:pgo
(Windows) or -qopt-report-phase=pgo
(Linux* and macOS*) which specifies that the optimization report is to
be generated for the Profile Guided Optimization phase.
.sln
file"prof_gen"
configuration from the toolbar"prof_use"
configuration. ifort /Qprof-gen src\pgo_sample.f90
pgo_sample.exe
ifort /Qprof-use /Qopt-report:1 /Qopt-report-phase:pgo src\pgo_sample.f90
source <ifort-install-dir>/bin/compilervars.sh {ia32|intel64}
ifort -prof-gen src/pgo_sample.f90
pgo_sample.exe
ifort -prof-use -qopt-report=1 -qopt-report-phase=pgo src/pgo_sample.f90
Note:that the when the build is done with /Qprof-use or -prof-use
, the compiler will comment that
_ADDERMOD
has no .DYN
information. This is because _ADDERMOD
is a null routine
generated for the module and it is never called.